-
Notifications
You must be signed in to change notification settings - Fork 125
Build : Add more SCons 'Depends' onto the python modules #1185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build : Add more SCons 'Depends' onto the python modules #1185
Conversation
|
Hmm standby, this seems to not solve the issue yet & needs a bit more investigating... |
78588f2 to
cc158e3
Compare
|
Alright I had to make it depend on the actual install rather than the module itself, seems to work now here. |
andrewkaufman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it took a while to get to this @boberfly. I've suggested a change that I think should be applied to all the other modules as well.
Happy to take that on if you don't have time.
| corePythonModule = corePythonModuleEnv.SharedLibrary( "python/IECore/_IECore", corePythonModuleSources ) | ||
| corePythonModuleEnv.Depends( corePythonModule, coreLibrary ) | ||
| corePythonModuleEnv.Depends( corePythonModule, corePythonLibrary ) | ||
| corePythonModuleEnv.Depends( corePythonModule, corePythonLibraryInstall ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about this change. You should be able to run scons without anything actually installing, it all just compiles in-place, but this change would cause libIECorePython.so to actually install.
I think this line was correct before, and what you're needing is for corePythonModuleInstall to depend on corePythonLibraryInstall.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
index ab0fa4b66..c482335fe 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1763,10 +1763,11 @@ corePythonModuleEnv.Append( LIBS = os.path.basename( coreEnv.subst( "$INSTALL_LI
corePythonModuleEnv.Append( LIBS = os.path.basename( corePythonEnv.subst( "$INSTALL_PYTHONLIB_NAME" ) ) )
corePythonModule = corePythonModuleEnv.SharedLibrary( "python/IECore/_IECore", corePythonModuleSources )
corePythonModuleEnv.Depends( corePythonModule, coreLibrary )
-corePythonModuleEnv.Depends( corePythonModule, corePythonLibraryInstall )
+corePythonModuleEnv.Depends( corePythonModule, corePythonLibrary )
corePythonModuleInstall = corePythonModuleEnv.Install( "$INSTALL_PYTHON_DIR/IECore", corePythonScripts + corePythonModule )
corePythonModuleEnv.AddPostAction( "$INSTALL_PYTHON_DIR/IECore", lambda target, source, env : makeSymLinks( corePythonEnv, corePythonEnv["INSTALL_PYTHON_DIR"] ) )
+corePythonModuleEnv.Depends( corePythonModuleInstall, corePythonLibraryInstall )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @andrewkaufman
I ran into this one again and the exact issue is: /opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: /dependencies-5e01d53f74c525306a27c497de35e1a0510d6546-source/gafferDependenciesBuild/lib/libIECorePython.so: file not recognized: file truncated
My memory might be wrong, but your suggestion I think didn't work for me until I used the corePythonLibraryInstall as the dependency, perhaps the dependent modules try to link to the installed one? Not sure...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying it now with a rebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an update, the requested change from @andrewkaufman still caused race conditions in the build for me, so I've kept the depends to corePythonLibraryInstall so this is just a rebase.
20bd443 to
6b04bc5
Compare
…ttempt to link before IECorePython can have enough time to generate a lib to link to on multiple job threads.
6b04bc5 to
b983f3e
Compare
ivanimanishi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @boberfly offline, my best guess is that in all such cases we technically need the libraries not only built, but also "installed" in order to be usable by dependent build operations.
It's therefore necessary to set all similar dependency relationships to the "Install" node instead of the "build" node for a library.
At a minimum, it does guarantee that the build operation is fully complete before starting the next build.
|
Hang on, isn't there a reason that |
|
Right... I see your point. But then I don't really understand how @boberfly is getting the errors. But if you are correct, then it would need to be looking for it in the build location, in which case I don't understand how the library wouldn't be available with the old code. Andrew's last suggestion about "install depends on install" didn't work, and doesn't seem like it would anyway. |
I think we should be getting them from where they're built, in
I don't either. I do |
|
@johnhaddon, In that scenario, it may be that creating the dependency to |
|
No. The |
|
I'm resetting the main branch to the previous state (before merging this PR), until we can sort this out. |
|
@johnhaddon hmm I get this like 90% of the time, but my system is probably A quick search for bash shows that |
|
Reverted here: 4cb69f0 |
We do want to get this sorted out properly in the SConstruct, but I don't think we're (or at least I'm) at a point where we truly understand the problem. Rather than tell SCons to wait until the installs are done, I think we want to make sure that SCons is picking up |
@boberfly, do you have the command line that triggered this error? I'm wondering if the linker is searching |
|
Aha! Today I fell victim to this same error too! And I can confirm that
So I think we just need to get those |
Build : Add more SCons 'Depends' onto the python modules, they will attempt to link before IECorePython can have enough time to generate a lib to link to on multiple job threads.
The woes of running on something that can spin 128 threads...
Related Issues
Dependencies
Breaking Changes
Checklist